<?php
/**
 * PHP Framework UI EntityGridActionType class
 * This class represents type metadata for an entity grid action
 *
 * @author Andrew <andrew@vitche.com>
 * @author Frozen Rain <frozenrain@mail.ru>
 **/
class EntityGridActionType extends Type {

    protected $_class = null;

    protected $_method = null;

    protected $_name = null;

    public function getClass() {
        return $this->_class;
    }

    public function setClass($strClass) {
        $this->_class = $strClass;
    }

    public function getMethod() {
        return $this->_method;
    }

    public function setMethod($strMethod) {
        $this->_method = $strMethod;
    }

    public function getName() {
        return $this->_name;
    }

    public function setName($strName) {
        $this->_name = $strName;
    }

    /**
     * TODO: Replace with a JSON call builder
     **/
    public function toString() {
        $strClass = $this->_class;
        if (!isset($strClass)) {
            $strClass = $this->_object->type->getClass();
        }
        return "Framework.DomainModel.Entity.call(\"$strClass\", \"$this->_method\", null, null); document.location = document.location;";
    }
}
?>